package com.summer.dingding.util;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;

import com.summer.core.util.LocalConstants;

public class DingDingConstants {

	public static final class Config {
		
		private static Properties props;
		static {
			props = new Properties();
			try {
				props.load(DingDingConstants.class.getClassLoader()
						.getResourceAsStream("dingding.properties"));
			} catch (FileNotFoundException e) {
				throw new RuntimeException("找不到dingding.properties文件", e);
			} catch (IOException e) {
				throw new RuntimeException("读取dingding.properties文件出错", e);
			}
		}
		
		public static final String CORPID = "ding03eb815037fad9ac35c2f4657eb6378f";
		public static final String CORPSECRET = "_F-y1Z4a6RdPufP0EqySIxvI092Df_vjfC9TaJjeCi3lTqgokdndmLF5wpLzGs7E";
		public static final Long AGENTID = Long.parseLong(props.getProperty("agentid")); 
		public static final class CodeLogin {
			
			public static final String APPID = props.getProperty("code_login.appId");
			public static final String APP_SECRET = props.getProperty("code_login.appSecret");
			public static final String REDIRECT_URL_BIND = LocalConstants.Config.RETURN_WEB + "/dingdingBindWeb";
			public static final String REDIRECT_URL_LOGIN = LocalConstants.Config.RETURN_WEB + "/dingdingLoginWeb";
		}
	}
}
